package com.rexolar.openapi.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ErrorCodeEnum
 *
 * @author zhusiyu
 **/
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum ErrorCodeEnum {

    /**
     *
     */
    SUCCESS(10000, "成功"),
    SYSTEM_ERROR(20000, "服务不可用"),
    USER_NOT_AUTHORIZED(20001, "授权权限不足"),
    USER_LOGIN_NO_TOKEN(20002, "缺少登陆Token信息"),
    USER_LOGIN_TOKEN_EXPIRE(20004, "Token异常，请重新登录"),
    USER_APP_STOP(20003, "该app尚未启用，请联系管理员"),
    LESS_PARAMETERS(40001, "缺少必选参数"),
    LESS_PARAMETERS_APPKEY(4000101, "缺少必选参数appKey"),
    LESS_PARAMETERS_SIGN(4000102, "缺少必选参数sign"),
    ILLEGAL_PARAMETERS_APPKEY_NOT_EXIST(4000103, "appKey不存在"),
    ILLEGAL_PARAMETERS_SIGN_CHECK_ERROR(4000104, "签名验证失败"),
    LESS_PARAMETERS_TimeStamp(4000105, "缺少必选参数timestamp"),
    LESS_PARAMETERS_INVALID_TimeStamp(4000106, "非法的时间戳参数"),
    ILLEGAL_PARAMETERS_OVERSIZE(4000107, "参数超出长度范围"),
    ILLEGAL_PARAMETERS_GWNAME(40002, "参数不合法,网关名称已经存在"),
    ILLEGAL_PARAMETERS_CLIENT_ID(400021, "参数不合法,网关三元组clientId已经存在"),
    ILLEGAL_PARAMETERS_CLIENT_ERR(400022, "参数不合法,网关三元组clientId长度不能超过12个字符"),
    ILLEGAL_PARAMETERS_USERNAME_NULL(400022, "参数不合法,网关三元组username不能为空"),
    ILLEGAL_PARAMETERS_USERNAME_ERR(400023, "参数不合法,网关三元组clientId长度不能超过10个字符"),
    ILLEGAL_PARAMETERS_PWD_NULL(400024, "参数不合法,网关三元组password不能为空"),
    ILLEGAL_PARAMETERS_PWD_ERR(400025, "参数不合法,网关三元组password长度不能超过20个字符"),
    ILLEGAL_PARAMS_LEN_MORE_1024(40003, "参数长度大于1024，请使用POST方式请求"),
    ILLEGAL_TIME_RANGE(40004, "参数非法，起始和结束时间有误！"),
    ILLEGAL_TIME_RANGE_OVERSIZE(40005, "参数非法，起始和结束时间跨度超过1天"),
    ILLEGAL_TIME_FORMAT(40005, "参数非法，起始和结束时间格式错误"),
    ILLEGAL_GW_NUM_OVERSIZE(40007, "参数不合法,批量申请网关个数过多"),
    ILLEGAL_DEVICE_OVERSIZE(40008, "参数不合法,设备ID个数过多"),
    ILLEGAL_DEVICE_ATTR(40009, "设备属性数据异常"),
    ILLEGAL_DEVICE_GW_NOT_EXIST(40010, "设备关联的网关不存在"),
    ILLEGAL_DEVICE_NOT_EXIST(40011, "设备不存在"),
    ILLEGAL_GW_NOT_EXIST(40012, "网关不存在"),
    ILLEGAL_PARAMETERS_USER_EXIST(40013, "参数不合法,用户已经存在"),
    ILLEGAL_PARAMETERS_ProFile_NOT_EXIST(40014, "参数不合法,网关配置信息不存在"),
    ILLEGAL_PARAMETERS_JSON_ERROR(40015, "参数不合法,非JSON格式"),
    ILLEGAL_PARAMETERS_USER_PASSWORD(40016, "参数不合法,用户名或密码错误"),


    LESS_AUTHORIZED(50006, "权限不足"),
    ACCESS_LIMIT(50001, "访问受限"),
    USER_ACCESS_LIMIT(50002, "用户访问受限"),
    ;
    /**
     * 错误码
     */
    private int code;
    /**
     * 错误信息
     */
    private String message;
}
